<?PHP

$subcategories = $categories;


?>

	<ul>
			<li id='shop_by'>
					Shop By
		
			</li>
	
	

						<li class='headlink'>tae
					<a href='sc'>Category</a>
							
							<ul class='secondlink'>
							<?PHP
								
								foreach($categories as $x)
								{


									if($x['parent']==0)
									{
									
								
										?>
							
							
							
										<li>
											<a href="sc/<?PHP echo $x['id'];?>/category/<?PHP echo convert_string_to_query($y['name']);?>">										<?PHP echo $x['name'];?>
											</a>
										
											
											
										
											<ul class='thirdlink' style='display:none'>
													<?PHP

														foreach($subcategories as $y)
														{


															if($y['parent']==$x['id'])
															{

																?>



																<li>
																	<a href="sc/<?PHP echo $y['id'];?>/category/<?PHP echo csq($y['name']);?>">										<?PHP echo $y['name'];?>
																	</a>
																</li>
																<?PHP




															}
														}
														?>
											</ul>
										</li>
										<?PHP
								
								
								
								
									}
								}
								?>
								
								
								
								
							</ul>
						</li>
								<li class='headlink'>
									<a href='manufacturer'>Manufacturer</a>
									
										<ul class='secondlink'>
											
											<?php
											foreach ($menu_manufacturers->data as $x)
											{
												if(!empty($x['thumbnail']))
												{				
													$thumb=ap($x['thumbnail']);
												}
												?>	

														<li>
															<a href="sc/<?PHP echo $x['id'];?>/manufacturer/<?PHP echo csq($x['name']);?>">
																<?PHP echo $x['name'];?>

																</a>

														</li>

												<?PHP

											} //end foreach
											?>
										</ul>
							
								</li>
	</ul>
	
	<script type="text/javascript">
		$(document).ready(function(){
				$('li.headlink').hover(
					function() { $('.secondlink', this).fadeIn(250); },
					function() { $('.secondlink', this).fadeOut(250) });
					
						$('.secondlink li').hover(
							function() { $('.thirdlink', this).fadeIn(250); },
							function() { $('.thirdlink', this).fadeOut(250) });
			});
		
	</script>